package com.yuhanginfo.modules.web.entity;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.hibernate.validator.constraints.Length;

import com.yuhanginfo.common.persistence.WebDataEntity;
import com.yuhanginfo.common.utils.StringUtils;

/**
 * 商品套餐Entity
 * @author lvls
 * @version 2017-11-15
 */
public class WebGoodsCombo extends WebDataEntity<WebGoodsCombo> {
	
	private static final long serialVersionUID = 1L;
	private String code;		// 套餐编号
	private String name;		// 套餐名称
	private String photo;		// 套餐图片
	private BigDecimal price;		// 套餐价格
	private Integer status;		//0:待上架 1:上架 2:下架
	private Integer isHistory;
	private String mainPhoto;
	private String upStoreNames; //上架门店列表
	private BigDecimal oldPrice;//原价
	private String storeCode;//当前点击套餐所属门店
	private String storeArea;//当前点击套餐所属门店
	private String madeBy;//当前点击套餐所属门店
	private List<String> detailImageList;
	public WebGoodsCombo() {
		super();
	}

	public WebGoodsCombo(String id){
		super(id);
	}

	@Length(min=0, max=50, message="套餐编号长度必须介于 0 和 50 之间")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@Length(min=0, max=50, message="套餐名称长度必须介于 0 和 50 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=500, message="套餐图片长度必须介于 0 和 500 之间")
	public String getPhoto() {
		return photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}
	
	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getUpStoreNames() {
		return upStoreNames;
	}

	public void setUpStoreNames(String upStoreNames) {
		this.upStoreNames = upStoreNames;
	}

	public BigDecimal getOldPrice() {
		return oldPrice;
	}

	public void setOldPrice(BigDecimal oldPrice) {
		this.oldPrice = oldPrice;
	}

	public String getStoreCode() {
		return storeCode;
	}

	public void setStoreCode(String storeCode) {
		this.storeCode = storeCode;
	}

	public String getStoreArea() {
		return storeArea;
	}

	public void setStoreArea(String storeArea) {
		this.storeArea = storeArea;
	}

	public String getMadeBy() {
		return madeBy;
	}

	public void setMadeBy(String madeBy) {
		this.madeBy = madeBy;
	}

	public Integer getIsHistory() {
		return isHistory;
	}

	public void setIsHistory(Integer isHistory) {
		this.isHistory = isHistory;
	}

	public List<String> getDetailImageList() {
		if(StringUtils.isNotBlank(remarks)) {
			String[] im=remarks.split(";");
			return Arrays.asList(im);
		}else {
			this.detailImageList = new ArrayList<String>();
			return detailImageList;
		}
	}

	public void setDetailImageList(List<String> detailImageList) {
		this.detailImageList = detailImageList;
	}

	public String getMainPhoto() {
		return mainPhoto;
	}

	public void setMainPhoto(String mainPhoto) {
		this.mainPhoto = mainPhoto;
	}
	
}